<section class="news-section panel panel-default">
  <h2 class="h4 section-title primary-line">资讯
    <a href="{{ path('article_show') }}" title="" class="section-more pull-right">更多>></a>
  </h2>

  <!-- 资讯标签页 -->
  <div class="tab news-tab">

    {% set articleCategories = data('ArticleCategory',{'count':0}) %}
    {#{% for artilceCategory in articleCategories %}
    {{ artilceCategory.name }}
    {% endfor %}#}
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
      <li role="presentation" class="active"><a href="#latest-news" aria-controls="latest-news" role="tab" data-toggle="tab">最新</a></li>
      {% for artilceCategory in articleCategories %}
      <li role="presentation"><a href="#{{ artilceCategory.code }}" aria-controls="{{ artilceCategory.code }}" role="tab" data-toggle="tab">{{ artilceCategory.name }}</a></li>
      {% endfor %}
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
      <div role="tabpanel" class="tab-pane active" id="latest-news">
        <ul class="news-panel">
          {% set LatestArticles = data('LatestArticles',{'count':10}) %}
          {% for latestArticle in LatestArticles %}
          <li class="list-item row">
            <div class="col-sm-12">
              <h3 class="news-title text-wrap h4">
                {% set latestArticle_category = data('ArticleCategoryById',{'id':latestArticle.categoryId}) %}
                <a href="{{ path('article_detail', {id:latestArticle.id}) }}" title="">{{latestArticle.title}}</a>
              </h3>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>

      {% set articles_1 = data('LatestArticles',{'count':10,'categoryId':4}) %}
      {% set articles_1_category = data('ArticleCategoryById',{'id':4}) %}
      <div role="tabpanel" class="tab-pane" id="{{articles_1_category.code}}">
        <ul class="news-panel">
          {% for article_1 in articles_1 %}
          <li class="list-item row">
            <div class="col-sm-12">
              <h3 class="news-title text-wrap h4">
                {#<a href="{{path('article_category', {categoryCode:articles_1_category.code})}}" class="news-category">[{{articles_1_category.name}}]</a>#}
                <a href="{{ path('article_detail', {id:article_1.id}) }}" title="{{ article_1.title }}">{{article_1.title}}</a>
              </h3>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>

      {% set articles_1 = data('LatestArticles',{'count':10,'categoryId':5}) %}
      {% set articles_1_category = data('ArticleCategoryById',{'id':5}) %}
      <div role="tabpanel" class="tab-pane" id="{{articles_1_category.code}}">
        <ul class="news-panel">
          {% for article_1 in articles_1 %}
          <li class="list-item row">
            <div class="col-sm-12">
              <h3 class="news-title text-wrap h4">
                {#<a href="{{path('article_category', {categoryCode:articles_1_category.code})}}" class="news-category">[{{articles_1_category.name}}]</a>#}
                <a href="{{ path('article_detail', {id:article_1.id}) }}" title="{{ article_1.title }}">{{article_1.title}}</a>
              </h3>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>

      {% set articles_2 = data('LatestArticles',{'count':10,'categoryId':6}) %}
      {% set articles_2_category = data('ArticleCategoryById',{'id':6}) %}
      <div role="tabpanel" class="tab-pane" id="{{articles_2_category.code}}">
        <ul class="news-panel">
          {% for article_2 in articles_2 %}
          <li class="list-item row">
            <div class="col-sm-12">
              <h3 class="news-title text-wrap h4">
                {#<a href="{{path('article_category', {categoryCode:articles_2_category.code})}}" class="news-category">[{{articles_2_category.name}}]</a>#}
                <a href="{{ path('article_detail', {id:article_2.id}) }}" title="{{ article_2.title }}">{{article_2.title}}</a>
              </h3>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>

      {% set articles_3 = data('LatestArticles',{'count':10,'categoryId':7}) %}
      {% set articles_3_category = data('ArticleCategoryById',{'id':7}) %}
      <div role="tabpanel" class="tab-pane" id="{{articles_3_category.code}}">
        <ul class="news-panel">
          {% for article_3 in articles_3 %}
          <li class="list-item row">
            <div class="col-sm-12">
              <h3 class="news-title text-wrap h4">
                {#<a href="{{path('article_category', {categoryCode:articles_3_category.code})}}" class="news-category">[{{articles_3_category.name}}]</a>#}
                <a href="{{ path('article_detail', {id:article_3.id}) }}" title="{{ article_3.title }}">{{article_3.title}}</a>
              </h3>
            </div>
          </li>
          {% endfor %}
        </ul>
      </div>

    </div>
  </div>
  <a class="btn btn-block btn-lg btn-default" href="{{ path('article_show') }}" title="查看更多资讯">查看更多...</a>
</section>
